/**
 * 统一管理后台用户相关的接口
*/
import { requestHttp } from "@/utils/requestHttp.ts";

//@ts-ignore
import { userInfoResponseData } from "./type.ts";


//获取用户信息接口(根据用户名)
export const reqUserInfo = (username:string) => {
    return requestHttp<userInfoResponseData>({
        url:"/manage/adminUser",
        method:"get",
        params:{
            username:username
        }
    })
}

//获取后台所有管理员数据接口
export const reqUserInfoList = () => {
    return requestHttp<any>({
        url:"/manage/adminUsers",
        method:"get"
    })
}

//修改某个管理员用户信息(通过id)
export const reqUpdateUser = (user:any) => {
    return requestHttp<any>({
        url:"/manage/adminUser",
        method:"put",
        data:user
    })
}

//添加一个管理员用户
export const reqSaveUser = (user:any) => {
    return requestHttp<any>({
        url:"/manage/adminUser",
        method:"post",
        data:user
    })
}

//删除单个或多个管理员用户
export const reqDelUser = (usernameList:any) => {
    return requestHttp({
        url:"/manage/adminUser",
        method:"delete",
        data:usernameList
    })
}